class ChunkHandler:
    def __init__(self, file_path: str = "very_important_data.md", chunk_size: int = 1000):
        self.chunk_size = chunk_size
        with open(file_path, "r", encoding="utf-8") as f:
            self.file = f.read()

    def get_chunks(self) -> list[str]:
        """
        todo 分块调优
        自定义的分块函数
        其他：https://python.langchain.com/api_reference/text_splitters/character/langchain_text_splitters.character.RecursiveCharacterTextSplitter.html
        """
        chunks = self.file.split('\n\n')
        result = []
        header = ""
        for c in chunks:
            if c.startswith("#"):
                header += f"{c}\n"
            else:
                result.append(f"{header}{c}")
                header = ""
        return result